#pragma once

#include "Singleton.h"
#include "ObjectFactory.h"

class CFileExporter;
class GEOMDBAPI CFileExporterCreator
{
public:
	virtual CFileExporter* Create(void) = 0;
};

//////////////////////////////////////////////////////////////////////////
class GEOMDBAPI CFileExporterFactory
	: public ATools::TSingleton<CFileExporterFactory>,
	public ATools::TObjectFactory<CFileExporter, CString, CFileExporterCreator>
{
public:
	CFileExporterFactory(void);
	~CFileExporterFactory(void);
	void Initialize(void);
	CFileExporter* Create(const CString& szId);
};

inline CFileExporterFactory& GetFileExporterFactory()
{
	return CFileExporterFactory::Instance();
}

//////////////////////////////////////////////////////////////////////////

class GEOMDBAPI CRegFileExporterHelper
{
public:
	CRegFileExporterHelper(const CString& guid, CFileExporterCreator* pEditorCreator);
	~CRegFileExporterHelper();
protected:
	void Register(CFileExporterCreator* pCreator);
	const CString& m_Guid;
};

#define REGISTERE_FILEEXPORTER(FileExporter, Id) \
	static CRegFileExporterHelper s_regHelper##Editor(Id,\
	new ATools::TObjectCreator<FileExporter, CFileExporterCreator>());


